/******************************************************************************

	COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2010.

	This file is part of Maxsi Engine.

	Maxsi Engine is free software: you can redistribute it and/or modify it
	under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or (at your
	option) any later version.

	Maxsi Engine is distributed in the hope that it will be useful, but WITHOUT
	ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
	FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
	for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with Maxsi Engine. If not, see <http://www.gnu.org/licenses/>.

	MaxsiEngine.dll
	A general purpose C++ library for the Maxsi Technology Project.

	MaxsiTranslate.h
	A system for loading string table files and storing them in memory, so
	that when any parts of the application needs to be localized, strings can
	be easily localized using the Translate() function.

******************************************************************************/

#ifndef MaxsiTranslate_H
#define MaxsiTranslate_H

BeginMaxsiNamespace

STRUCTLINK MaxsiTranslateLanguage
{
	MESTR* Language;
	MESTR* StringTableName;
	MESTR** StringTable;
	size_t NumStrings;
};

LINK MaxsiError LoadMaxsiComponentConfiguration(MESTR* ComponentName);
LINK MaxsiError UnloadMaxsiComponentsConfigurations();

LINK MESTR* LookUpTranslation(MESTR* StringName);
LINK size_t AddStringTable(MESTR* Language, MESTR* StringTableName);
LINK MaxsiError LoadLanguageFile(MESTR* Language, MESTR* StringTableName);
LINK MaxsiError ParseLanguageFile(MESTR* Language, MESTR* StringTableName, MESTR* Data, size_t DataLength, size_t* NumStrings = NULL);

#define Translate(String) LookUpTranslation(_MESTR(String))

EndMaxsiNamespace

#endif
